﻿<UserControl
    x:Class="Srk.BetaseriesApiApp.Views.Friends"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:cmd="clr-namespace:Srk.BetaseriesApiApp.Controls"
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal">
            <TextBox Text="{Binding Username, UpdateSourceTrigger=PropertyChanged}" Width="180" Margin="4" />
            <Button Content="Go" Command="{Binding GetFriendsCommand}" Margin="4" />
            <Button Content="Stop" Command="{Binding StopCommand}" Margin="4" />
            <TextBlock Text="{Binding StatusMessage}" Margin="4">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseLeftButtonUp">
                        <cmd:EventToCommand Command="{Binding ShowErrorsCommand}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </TextBlock>
        </StackPanel>

        <ListView Grid.Row="2" ItemsSource="{Binding Members}" Height="220">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Username" DisplayMemberBinding="{Binding Username}" />
                    <GridViewColumn Header="Shows" DisplayMemberBinding="{Binding ShowCount}" />
                    <GridViewColumn Header="Seasons" DisplayMemberBinding="{Binding SeasonCount}" />
                    <GridViewColumn Header="Episodes" DisplayMemberBinding="{Binding EpisodeCount}" />
                    <GridViewColumn Header="EpisodesToWatch" DisplayMemberBinding="{Binding EpisodesToWatchCount}" />
                    <GridViewColumn Header="TimeSpent" DisplayMemberBinding="{Binding TimeSpent}" />
                    <GridViewColumn Header="TimeRemaining" DisplayMemberBinding="{Binding TimeRemaining}" />
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</UserControl>
